package com.docmanage.am.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.docmanage.common.annotation.Excel;
import com.docmanage.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 档案借阅对象 am_borrow
 *
 * @author pointLion
 * @date 2023-06-18
 */
@Data
public class AmBorrow extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    private Long id;

    private Long tenantId;

    /**
     * 档案id
     */
    private Long descId;

    @Excel(name = "档案标题")
    private String title;

    @Excel(name = "案卷号")
    private String fileCode;

    /**
     * 归还时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "归还时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date returnTime;

    /**
     * 借阅时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "借阅时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date borrowTime;

    /** 预计归还时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计归还时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date reckonReturnTime;

    /** 预计借阅时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "预计借阅时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date reckonBorrowTime;

    /**
     * 借阅天数
     */
    @Excel(name = "借阅天数")
    private BigDecimal days;

    /**
     * 借阅用途
     */
    @Excel(name = "借阅用途")
    private String reason;

    /**
     * 申请流程
     */
    @Excel(name = "申请流程")
    private String flowKey;

    /**
     * 流程实例id
     */
    @Excel(name = "流程实例id")
    private String flowInsId;

    /**
     * 提交时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "提交时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date submitTime;

    /**
     * 流程状态。0：未提交。1：审批中。2：已完成 3被驳回
     */
    @Excel(name = "流程状态。0：未提交。1：审批中。2：已完成 3：被驳回 5:已归还")
    private String status;

    @Excel(name = "流程状态")
    private String statusName;

    /**
     * 用户ID（单据 拥有者）
     */
    private Long userId;


    @Excel(name = "用户", readConverterExp = "单据拥有者")
    private String userName;

    /**
     * 部门ID（单据拥有部门）
     */
    @Excel(name = "部门ID", readConverterExp = "单=据拥有部门")
    private Long deptId;

    /**
     * 单据类型
     */
    @Excel(name = "单据类型")
    private String billType;

    private String billName;

    /**
     * 单据编码
     */
    @Excel(name = "单据编码")
    private String billCode;

    /**
     * 是否删除  0正常  1删除
     */
    @Excel(name = "是否删除  0正常  1删除")
    private Integer isDel;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("descId", getDescId())
                .append("returnTime", getReturnTime())
                .append("borrowTime", getBorrowTime())
                .append("days", getDays())
                .append("reason", getReason())
                .append("flowKey", getFlowKey())
                .append("flowInsId", getFlowInsId())
                .append("submitTime", getSubmitTime())
                .append("status", getStatus())
                .append("userId", getUserId())
                .append("deptId", getDeptId())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .append("billType", getBillType())
                .append("billCode", getBillCode())
                .append("tenantId", getTenantId())
                .append("isDel", getIsDel())
                .toString();
    }
}
